<#import "/spring.ftl" as spring/>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <#include "../head.ftl"/>
    <title>业务跟踪</title>
    <#include "viewPageSetting.ftl"/>
    <script type="text/javascript">
        var formSetting = {
            title: "报关单信息",
            module: 'save',
            columns: formColumnSetting,
            form: {
                'url': '',
                'data': function () {
                    var dataValue;
                    $.ajax({
                       url: "<@spring.url '/business/declaOpRec/recDeclarationInfoData'/>",
                       async: false,
                       method:'post',
                       data:{did:'${did}'},
                       dataType:'json',
                       success: function (data) {
                           if(data === undefined){
                               return;
                           }
                           dataValue = data;
                           var conta20 = dataValue.conta20;
                           var conta40 = dataValue.conta40;
                           var contaNum = "";
                           if(conta20){
                               contaNum = conta20 + '*20尺'
                           }
                           if(conta40){
                               if (contaNum.length > 0) {
                                   contaNum += " // ";
                               }
                               contaNum += conta40 + '*40尺'
                           }
                           delete dataValue['conta20'];
                           delete dataValue['conta40'];
                           if(conta20 || conta40){
                               contaNum.contaNo += "等";
                           }
                           dataValue.contaNum = contaNum;
                       }
                   });
                    return dataValue;
                }
            },
            buttons: {
                custom: buttonSetting
            }
        };
        var gridSetting = {
                grid: gridSetting
        };
        $(document).ready(function () {
            $("#formTable").mrdForm(formSetting);
            $("#gridTable").mrdForm(gridSetting);
            $("#saveButton").remove(); //移除mrdform自带保存按钮
            moveBtn();
        });

        function closeGridAndShowMsg(msg){
            $("#operationRecord").gridMethods().reload();
            parent.layer.closeAll();
            parent.layer.msg(msg);
        }

        function showMsg(msg){
            layer.msg(msg);
        }
        function moveBtn() {
            var btnTr = $("tr.mrdBtnTr");
            var btnContainer = btnTr.find("td#mf_buttons_container");
            btnContainer.attr("colspan", 3);
            btnContainer.css("text-align", "right");

            var btnContainerClone = btnContainer.clone();
            btnContainerClone.find("input:button").remove();
            btnContainerClone.attr({
                                       "id": "mf_buttons_container2",
                                       "colspan": "3"
                                   });
            btnContainerClone.appendTo(btnTr);

            $("#exportDocRecordExcl").appendTo(btnContainerClone);
        }
    </script>
</head>
<body>
<div id="formTable"></div>
<div id="gridTable"></div>
</body>
</html>
